package com.weilus.config.security;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;
import java.util.Map;

/**
 * Created by liutq on 2019/3/23.
 */
@Configuration
@ConfigurationProperties(prefix = "security.metadata-source")
public class SecurityMetadataSourcePropertity {

    private Map<String,String[]> rules;

    private List<GroupAuthority> groupAuthority;

    private List<String> noCheckToken;

    public Map<String,String[]> getRules() {
        return rules;
    }

    public void setRules(Map<String,String[]> rules) {
        this.rules = rules;
    }

    public List<String> getNoCheckToken() {
        return noCheckToken;
    }

    public void setNoCheckToken(List<String> noCheckToken) {
        this.noCheckToken = noCheckToken;
    }

    public List<GroupAuthority> getGroupAuthority() {
        return groupAuthority;
    }

    public void setGroupAuthority(List<GroupAuthority> groupAuthority) {
        this.groupAuthority = groupAuthority;
    }

    static class GroupAuthority{
        private String groupName;
        private Map<String,String> authorities;

        public String getGroupName() {
            return groupName;
        }

        public void setGroupName(String groupName) {
            this.groupName = groupName;
        }

        public Map<String, String> getAuthorities() {
            return authorities;
        }

        public void setAuthorities(Map<String, String> authorities) {
            this.authorities = authorities;
        }
    }
}
